<?php

	require_once("../../../inc/conecta.inc.php");
	
	if(isset($_GET['action'])){
		
		if($_GET['action'] == "delete"){
			$excluir = $_POST['excluir'];
			if(!empty($excluir)){
				for($i=0; $i<count($excluir); $i++){
					mysql_query("DELETE FROM `vagas_has_candidato` WHERE `candidato_idcandidato` = ".$excluir[$i]) or die (mysql_error());
					mysql_query("DELETE FROM `formacao_academica` WHERE `candidato_idcandidato` = ".$excluir[$i]) or die (mysql_error());
					mysql_query("DELETE FROM `experiencia_profissional` WHERE `candidato_idcandidato` = ".$excluir[$i]) or die (mysql_error());
					mysql_query("DELETE FROM `curriculo` WHERE `candidato_idcandidato` = ".$excluir[$i]) or die (mysql_error());
					mysql_query("DELETE FROM `candidato` WHERE `idcandidato` = ".$excluir[$i]) or die (mysql_error());
				}
			}
			header("location: ../../index.php?option=into&view=candidato");
		}
		
	}

?>